package com.pucheng.bracelet.data.bean

import androidx.room.ColumnInfo
import androidx.room.Entity
import androidx.room.Ignore
import androidx.room.PrimaryKey
import com.pucheng.bracelet.app.util.DatetimeUtil
import java.io.Serializable

@Entity(tableName = "steps")
data class StepsBean(
    @PrimaryKey var date: String = DatetimeUtil.formatDate(
        System.currentTimeMillis(),
        DatetimeUtil.DATE_PATTERN
    ),
    @ColumnInfo var stepsNum: String = "0",//步数
    @ColumnInfo var dateTime: String = DatetimeUtil.formatDate(System.currentTimeMillis(), DatetimeUtil.DATE_PATTERN_A_H),//时间
    @ColumnInfo var distance: Double = 0.0,//跑步距离
    @ColumnInfo var calorie: Int = 0,//消耗的卡路里
    @ColumnInfo var time: Double = 0.0//跑步时长
): Serializable{
    override fun toString(): String {
        return "StepsBean(步数='$stepsNum', 上报时间='$date', 距离=$distance, 卡路里=$calorie, 时长=$time)"
    }
}